/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.haiberg.osgi.bundle.helloword.tracker;

import com.haiberg.osgi.bundle.helloservice.HelloService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;

/**
 *
 * @author gyue
 */
public class HelloServiceTracker extends ServiceTracker{
    public HelloServiceTracker(BundleContext context){
        super(context, HelloService.class.getName(), null);
    }

    @Override
    public Object addingService(ServiceReference reference) {
        System.out.println("Inside HelloServiceTracker.addingService " + reference.getBundle());
        return super.addingService(reference); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void removedService(ServiceReference reference, Object service) {
        System.out.println("Inside HelloServiceTracker.removedService " + reference.getBundle());
        super.removedService(reference, service); //To change body of generated methods, choose Tools | Templates.
    }
}
